﻿import QtQuick 2.15
import QtQuick.Controls 2.15

Item {
    width: screenWidth
    height: screenHeight

    Item{
        id:backGround
        anchors.fill: parent
    }

    Rectangle{
        anchors.fill: backGround
        color: "#09295c"
    }

    Rectangle{
        anchors.top: backGround.top
        anchors.topMargin: 210
        anchors.left: backGround.left
        anchors.leftMargin: 10
        color: "#0b49b0"
        border.width: 1
        border.color: "#008edd"
        width: 1060
        height: 1400


        Text{
            anchors.top: parent.top
            anchors.topMargin: 100
            anchors.left: parent.left
            anchors.leftMargin: 200
            font.pixelSize: 50
            font.bold: true
            color:"white"
            text:"压力手动速度"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 80
            anchors.left: parent.left
            anchors.leftMargin: 600
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 压力手动速度
                id:stressManualSpeed
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.stressMaunalSpeed
            }

            TextInput{
                id:stressManualSpeed_Input
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                visible: false
                color: "white"
                selectByMouse: true
                maximumLength: 8
                //@disabel-check M16
                // verticalAlignment: Text.verticalAlignment
                horizontalAlignment: Text.horizontalAlignment
                text:stressManualSpeed.text
                //@disabel-check M16
                // onEditingFinished: {
                //     stressManualSpeed.text = stressManualSpeed_Input.text
                //     stressManualSpeed_Input.visible = false
                //     stressManualSpeed.visible = true
                // }
                onAccepted: {
                    stressManualSpeed_Input.visible = false
                    stressManualSpeed.visible = true
                    Cpp_Connect.write_modbus_tcp_TwoHoldingResgisters("3432",stressManualSpeed_Input.text)
                }
            }

            MouseArea{
                anchors.fill: parent
                acceptedButtons: Qt.LeftButton
                //@disabel-check M16
                propagateComposedEvents: true

                onClicked: {
                    mouse.accepted = false
                    stressManualSpeed.visible = false
                    stressManualSpeed_Input.visible = true
                    stressManualSpeed_Input.forceActiveFocus()
                }
            }
        }


        Text{
            anchors.top: parent.top
            anchors.topMargin: 270
            anchors.left: parent.left
            anchors.leftMargin: 200
            font.pixelSize: 50
            font.bold: true
            color:"white"
            text:"压力自动速度"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 250
            anchors.left: parent.left
            anchors.leftMargin: 600
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 压力自动速度
                id:stressAutoSpeed
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.stressAutoSpeed
            }

            TextInput{
                id:stressAutoSpeed_Input
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                visible: false
                color: "white"
                selectByMouse: true
                maximumLength: 8
                //@disabel-check M16
                // verticalAlignment: Text.verticalAlignment
                horizontalAlignment: Text.horizontalAlignment
                text:stressAutoSpeed.text
                // //@disabel-check M16
                // onEditingFinished: {
                //     stressAutoSpeed.text = stressAutoSpeed_Input.text
                //     stressAutoSpeed_Input.visible = false
                //     stressAutoSpeed.visible = true
                // }
                onAccepted: {
                    stressAutoSpeed_Input.visible = false
                    stressAutoSpeed.visible = true
                    Cpp_Connect.write_modbus_tcp_TwoHoldingResgisters("3436",stressAutoSpeed_Input.text)
                }
            }

            MouseArea{
                anchors.fill: parent
                acceptedButtons: Qt.LeftButton
                //@disabel-check M16
                propagateComposedEvents: true

                onClicked: {
                    mouse.accepted = false
                    stressAutoSpeed.visible = false
                    stressAutoSpeed_Input.visible = true
                    stressAutoSpeed_Input.forceActiveFocus()
                }
            }
        }


        Text{
            anchors.top: parent.top
            anchors.topMargin: 440
            anchors.left: parent.left
            anchors.leftMargin: 200
            font.pixelSize: 50
            font.bold: true
            color:"white"
            text:"前后刀手动速度"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 420
            anchors.left: parent.left
            anchors.leftMargin: 600
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 前后刀手动速度
                id:f_b_KnifeManualSpeed
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.knifeManualSpeed
            }

            TextInput{
                id:f_b_KnifeManualSpeed_Input
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                visible: false
                color: "white"
                selectByMouse: true
                maximumLength: 8
                //@disabel-check M16
                // verticalAlignment: Text.verticalAlignment
                horizontalAlignment: Text.horizontalAlignment
                text:f_b_KnifeManualSpeed.text
                // //@disabel-check M16
                // onEditingFinished: {
                //     f_b_KnifeManualSpeed.text = f_b_KnifeManualSpeed_Input.text
                //     f_b_KnifeManualSpeed_Input.visible = false
                //     f_b_KnifeManualSpeed.visible = true
                // }
                onAccepted: {
                    f_b_KnifeManualSpeed_Input.visible = false
                    f_b_KnifeManualSpeed.visible = true
                    Cpp_Connect.write_modbus_tcp_TwoHoldingResgisters("3440",f_b_KnifeManualSpeed_Input.text)
                }
            }

            MouseArea{
                anchors.fill: parent
                acceptedButtons: Qt.LeftButton
                //@disabel-check M16
                propagateComposedEvents: true

                onClicked: {
                    mouse.accepted = false
                    f_b_KnifeManualSpeed.visible = false
                    f_b_KnifeManualSpeed_Input.visible = true
                    f_b_KnifeManualSpeed_Input.forceActiveFocus()
                }
            }
        }

        Text{
            anchors.top: parent.top
            anchors.topMargin: 610
            anchors.left: parent.left
            anchors.leftMargin: 200
            font.pixelSize: 50
            font.bold: true
            color:"white"
            text:"前后刀自动速度"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 590
            anchors.left: parent.left
            anchors.leftMargin: 600
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 前后刀自动速度
                id:f_b_KnifeAutoSpeed
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.knifeAutoSpeed
            }

            TextInput{
                id:f_b_KnifeAutoSpeed_Input
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                visible: false
                color: "white"
                selectByMouse: true
                maximumLength: 8
                //@disabel-check M16
                // verticalAlignment: Text.verticalAlignment
                horizontalAlignment: Text.horizontalAlignment
                text:f_b_KnifeAutoSpeed.text
                // //@disabel-check M16
                // onEditingFinished: {
                //     f_b_KnifeAutoSpeed.text = f_b_KnifeAutoSpeed_Input.text
                //     f_b_KnifeAutoSpeed_Input.visible = false
                //     f_b_KnifeAutoSpeed.visible = true
                // }
                onAccepted: {
                    f_b_KnifeAutoSpeed_Input.visible = false
                    f_b_KnifeAutoSpeed.visible = true
                    Cpp_Connect.write_modbus_tcp_TwoHoldingResgisters("3444",f_b_KnifeAutoSpeed_Input.text)
                }
            }

            MouseArea{
                anchors.fill: parent
                acceptedButtons: Qt.LeftButton
                //@disabel-check M16
                propagateComposedEvents: true

                onClicked: {
                    mouse.accepted = false
                    f_b_KnifeAutoSpeed.visible = false
                    f_b_KnifeAutoSpeed_Input.visible = true
                    f_b_KnifeAutoSpeed_Input.forceActiveFocus()
                }
            }
        }


        Text{
            anchors.top: parent.top
            anchors.topMargin: 780
            anchors.left: parent.left
            anchors.leftMargin: 200
            font.pixelSize: 50
            font.bold: true
            color:"white"
            text:"后刀1偏移量"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 760
            anchors.left: parent.left
            anchors.leftMargin: 600
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 后刀1偏移量
                id:f_Knife01Offset
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.b_knife01_Offset
            }

            TextInput{
                id:f_Knife01Offset_Input
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                visible: false
                color: "white"
                selectByMouse: true
                maximumLength: 8
                //@disabel-check M16
                // verticalAlignment: Text.verticalAlignment
                horizontalAlignment: Text.horizontalAlignment
                text:f_Knife01Offset.text
                // //@disabel-check M16
                // onEditingFinished: {
                //     f_Knife01Offset.text = f_Knife01Offset_Input.text
                //     f_Knife01Offset_Input.visible = false
                //     f_Knife01Offset.visible = true
                // }
                onAccepted: {
                    f_Knife01Offset_Input.visible = false
                    f_Knife01Offset.visible = true
                    Cpp_Connect.write_modbus_tcp_TwoHoldingResgisters("3332",f_Knife01Offset_Input.text)
                }
            }

            MouseArea{
                anchors.fill: parent
                acceptedButtons: Qt.LeftButton
                //@disabel-check M16
                propagateComposedEvents: true

                onClicked: {
                    mouse.accepted = false
                    f_Knife01Offset.visible = false
                    f_Knife01Offset_Input.visible = true
                    f_Knife01Offset_Input.forceActiveFocus()
                }
            }
        }


        Text{
            anchors.top: parent.top
            anchors.topMargin: 950
            anchors.left: parent.left
            anchors.leftMargin: 200
            font.pixelSize: 50
            font.bold: true
            color:"white"
            text:"后刀2偏移量"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 930
            anchors.left: parent.left
            anchors.leftMargin: 600
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 后刀2偏移量
                id:f_Knife02Offset
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.b_knife02_Offset
            }

            TextInput{
                id:f_Knife02Offset_Input
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                visible: false
                color: "white"
                selectByMouse: true
                maximumLength: 8
                //@disabel-check M16
                // verticalAlignment: Text.verticalAlignment
                horizontalAlignment: Text.horizontalAlignment
                text:f_Knife02Offset.text
                // //@disabel-check M16
                // onEditingFinished: {
                //     f_Knife02Offset.text = f_Knife02Offset_Input.text
                //     f_Knife02Offset_Input.visible = false
                //     f_Knife02Offset.visible = true
                // }
                onAccepted: {
                    f_Knife02Offset_Input.visible = false
                    f_Knife02Offset.visible = true
                    Cpp_Connect.write_modbus_tcp_TwoHoldingResgisters("3336",f_Knife02Offset_Input.text)
                }
            }

            MouseArea{
                anchors.fill: parent
                acceptedButtons: Qt.LeftButton
                //@disabel-check M16
                propagateComposedEvents: true

                onClicked: {
                    mouse.accepted = false
                    f_Knife02Offset.visible = false
                    f_Knife02Offset_Input.visible = true
                    f_Knife02Offset_Input.forceActiveFocus()
                }
            }
        }

        Text{
            anchors.top: parent.top
            anchors.topMargin: 1120
            anchors.left: parent.left
            anchors.leftMargin: 200
            font.pixelSize: 50
            font.bold: true
            color:"white"
            text:"后刀3偏移量"
        }

        Rectangle{
            width: 300
            height: 80
            anchors.top: parent.top
            anchors.topMargin: 1100
            anchors.left: parent.left
            anchors.leftMargin: 600
            color: "#00adfb"
            radius: 10
            border.width: 1
            border.color: "#008edd"

            Text{           // 后刀3偏移量
                id:f_Knife03Offset
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                color: "white"
                text: Cpp_Connect.b_knife03_Offset
            }

            TextInput{
                id:f_Knife03Offset_Input
                anchors.centerIn: parent
                font.pixelSize: 40
                font.bold: true
                visible: false
                color: "white"
                selectByMouse: true
                maximumLength: 8
                //@disabel-check M16
                // verticalAlignment: Text.verticalAlignment
                horizontalAlignment: Text.horizontalAlignment
                text:f_Knife03Offset.text
                // //@disabel-check M16
                // onEditingFinished: {
                //     f_Knife03Offset.text = f_Knife03Offset_Input.text
                //     f_Knife03Offset_Input.visible = false
                //     f_Knife03Offset.visible = true
                // }
                onAccepted: {
                    f_Knife03Offset_Input.visible = false
                    f_Knife03Offset.visible = true
                    Cpp_Connect.write_modbus_tcp_TwoHoldingResgisters("3340",f_Knife03Offset_Input.text)
                }
            }

            MouseArea{
                anchors.fill: parent
                acceptedButtons: Qt.LeftButton
                //@disabel-check M16
                propagateComposedEvents: true

                onClicked: {
                    mouse.accepted = false
                    f_Knife03Offset.visible = false
                    f_Knife03Offset_Input.visible = true
                    f_Knife03Offset_Input.forceActiveFocus()
                }
            }
        }

    }



}
